<%@ page language="java" contentType="text/html; charset=UTF8" pageEncoding="UTF8"%>
<%@ include file="/jsp/base/taglibs.jsp"%>
<form action="#" id="edit-form">
<input type="hidden" name="id" value="${outing.id }" />
<table class="table">
	<tr>
		<td>外出人：</td>
		<td colspan="3">
			<input type="text" name="username" value="${outing.username }" />
		</td>
	</tr>
	<tr>
		<td>外出地点：</td>
		<td colspan="3">
			<input type="text" name="addr" value="${outing.addr }"/>
		</td>
	</tr>
	<tr>
		<td>开始时间：</td>
		<td>
			<input type="text" name="startTime" value='<fmt:formatDate value="${outing.startTime }" pattern="yyyy-MM-dd HH:mm" />' />
		</td>
		<td>结束时间：</td>
		<td>
			<input type="text" name="endTime" value='<fmt:formatDate value="${outing.endTime }" pattern="yyyy-MM-dd HH:mm" />' />
		</td>
	</tr>
	<tr>
		<td>原因：</td>
		<td colspan="3">
			<textarea name="reason" style="width:400px">${outing.reason }</textarea>
		</td>
	</tr>
	<tr>
		<td>是否用车：</td>
		<td colspan="3">
			<input type="checkbox" name="iscar" value="1" />是否用车
		</td>
	</tr>
	<tr>
		<td>审批人：</td>
		<td colspan="3">
			<input type="text" name="viewer" value="${outing.viewer }" />
		</td>
	</tr>
	<tr>
		<td>短信提醒：</td>
		<td colspan="3">
			<input type="checkbox" name="send" value="1" />短信提醒
		</td>
	</tr>
	<tr>
		<td colspan="4" align="center">
			<a href="javascript:void(0)" class="btn btn-primary  " onclick="update()" >保存</a>
			<a href="javascript:void(0)" class="btn btn-default " onclick="closeModal()">取消</a>
		</td>
	</tr>
</table>
</form>
<script>
$(function() {
	var iscar = "${outing.iscar}";
	if(iscar == 1) {
		$("#edit-form input[name=iscar]").prop("checked", "checked");
	} else {
		$("#edit-form input[name=iscar]").removeProp("checked");
	}
	
	var send = "${outing.send}";
	if(send == 1) {
		$("#edit-form input[name=send]").prop("checked", "checked");
	} else {
		$("#edit-form input[name=send]").removeProp("checked");
	}
	
})
</script>
